{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "dataset.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "source": [
        "!pip install wfdb"
      ],
      "metadata": {
        "id": "0hYIGNP3UnLQ"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "!wget -r -N -c -np https://physionet.org/files/ptb-xl/1.0.1/"
      ],
      "metadata": {
        "id": "7JxIrWMbCqca"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "from google.colab import drive\n",
        "drive.mount('/content/drive/', force_remount = True)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "VgYqfLaxNv07",
        "outputId": "0f2c787f-53a6-4464-8211-21f9c501ec5b"
      },
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Mounted at /content/drive/\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "cd '/content/drive/My Drive/DSL'"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "MF5mlq9tDDPI",
        "outputId": "9ec3e514-586f-4ac5-bfe7-ad535d27be0e"
      },
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content/drive/My Drive/DSL\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import wfdb\n",
        "import ast\n",
        "\n",
        "def load_raw_data(df, sampling_rate, path):\n",
        "    if sampling_rate == 100:\n",
        "        data = [wfdb.rdsamp(path+f) for f in df.filename_lr]\n",
        "    else:\n",
        "        data = [wfdb.rdsamp(path+f) for f in df.filename_hr]\n",
        "    data = np.array([signal for signal, meta in data])\n",
        "    return data\n",
        "\n",
        "path = '/content/drive/My Drive/DSL/physionet.org/files/ptb-xl/1.0.1/'\n",
        "sampling_rate=100\n",
        "\n",
        "# load and convert annotation data\n",
        "Y = pd.read_csv(path+'ptbxl_database.csv', index_col='ecg_id')\n",
        "Y.scp_codes = Y.scp_codes.apply(lambda x: ast.literal_eval(x))\n",
        "\n",
        "# Load raw signal data\n",
        "X = load_raw_data(Y, sampling_rate, path)\n",
        "\n",
        "# Load scp_statements.csv for diagnostic aggregation\n",
        "agg_df = pd.read_csv(path+'scp_statements.csv', index_col=0)\n",
        "agg_df = agg_df[agg_df.diagnostic == 1]\n",
        "\n",
        "def aggregate_diagnostic(y_dic):\n",
        "    tmp = []\n",
        "    for key in y_dic.keys():\n",
        "        if key in agg_df.index:\n",
        "            tmp.append(agg_df.loc[key].diagnostic_class)\n",
        "    return list(set(tmp))\n",
        "\n",
        "# Apply diagnostic superclass\n",
        "Y['diagnostic_superclass'] = Y.scp_codes.apply(aggregate_diagnostic)\n",
        "\n",
        "# Split data into train and test (https://physionet.org/content/ptb-xl/1.0.1/)\n",
        "test_fold = 10\n",
        "dev_fold = 9\n",
        "# Train\n",
        "X_train = X[np.where((Y.strat_fold != test_fold) & (Y.strat_fold != dev_fold))]\n",
        "y_train = Y[(Y.strat_fold != test_fold) & (Y.strat_fold != dev_fold)].diagnostic_superclass\n",
        "#Dev\n",
        "X_dev = X[np.where(Y.strat_fold == dev_fold)]\n",
        "y_dev = Y[(Y.strat_fold == dev_fold)].diagnostic_superclass\n",
        "# Test\n",
        "X_test = X[np.where(Y.strat_fold == test_fold)]\n",
        "y_test = Y[Y.strat_fold == test_fold].diagnostic_superclass"
      ],
      "metadata": {
        "id": "yWkDOEUrLd9V"
      },
      "execution_count": 3,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "import pickle\n",
        "pickle_out = open(\"X.pickle\",\"wb\")\n",
        "pickle.dump(X, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y.pickle\",\"wb\")\n",
        "pickle.dump(Y, pickle_out)\n",
        "pickle_out.close()"
      ],
      "metadata": {
        "id": "aemJ_T48JqsC"
      },
      "execution_count": 37,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "X_train.shape"
      ],
      "metadata": {
        "id": "FW56V0UFTM4_",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "02628970-23c0-4d91-faf5-47b9b9c56f64"
      },
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(17441, 1000, 12)"
            ]
          },
          "metadata": {},
          "execution_count": 4
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "y_train.shape"
      ],
      "metadata": {
        "id": "UicK3FAGTQ09",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "17424199-6c1a-47de-d501-7ddf5a753624"
      },
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(17441,)"
            ]
          },
          "metadata": {},
          "execution_count": 5
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "X_dev.shape"
      ],
      "metadata": {
        "id": "1E3SC9POuNoA",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "33412409-693b-4eed-ca56-76adf55b5983"
      },
      "execution_count": 6,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(2193, 1000, 12)"
            ]
          },
          "metadata": {},
          "execution_count": 6
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "y_dev.shape"
      ],
      "metadata": {
        "id": "XPbFoX5JuOve",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "f36e5b9b-4390-49ba-de14-28d27fca4cfd"
      },
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(2193,)"
            ]
          },
          "metadata": {},
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "X_test.shape"
      ],
      "metadata": {
        "id": "UHMzYfjZTYF0",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "f3208958-946f-4bdf-8df8-f0ee93429b20"
      },
      "execution_count": 8,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(2203, 1000, 12)"
            ]
          },
          "metadata": {},
          "execution_count": 8
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "y_test.shape"
      ],
      "metadata": {
        "id": "KIhuwCYUTcB9",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "a2c590ec-4266-4a42-e646-fc0f83c6aca3"
      },
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(2203,)"
            ]
          },
          "metadata": {},
          "execution_count": 9
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import matplotlib.pyplot as plt\n",
        "plt.plot(X_train[0][:100,1])"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 283
        },
        "id": "hHBYq25yPfT7",
        "outputId": "307c1e4e-f65f-4223-90ac-c5af673afbf6"
      },
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7f208307ea50>]"
            ]
          },
          "metadata": {},
          "execution_count": 10
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ],
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA1TElEQVR4nO3dd3yb5b338c8lyZJXPOKReGQ7y0nIICQBQsNIKKPMQguFA7RQdqGlPefQU07P6Trdp095HiilzLaUMAuhBcKegUwSEmc60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C/Fn7fApkKaUKwj2W0QK/CKgIelzpf87QlFKTgYXAemCc1rrG/6laYFy8zitG/g/wb4DX/zgHaNZau/2PjXjNpwD1wOP+VtYjSqk0DHyttdZVwG+AI/iCvgXYjPGvdUB/13ZIGWe0wE84Sql04AXg21rr1uDPad+cW8PMu1VKfQmo01pvjve5DDMLsAj4g9Z6IdBBr/aNAa91Nr5qdgpQCKTRt+2REKJ5bY0W+FXAhKDHxf7nDEkplYQv7J/SWr/of/po4E88///Wxev8YuB04GKl1CF87bqz8fW2s/x/9oMxr3klUKm1Xu9//Dy+XwBGvtYrgYNa63qttQt4Ed/1N/q1Dujv2g4p44wW+BuB6f6RfCu+QZ41cT6nmPD3rh8Fdmmt/zfoU2uA6/0fXw+8PNznFita6+9rrYu11pPxXdt3tNbXAO8CV/hfZqj3DKC1rgUqlFIz/U+dA+zEwNcaXytnmVIq1f+9HnjPhr7WQfq7tmuA6/yzdZYBLUGtn4FprQ31H3ABsBfYD/wg3ucTw/e5HN+feZ8DW/3/XYCvp/02sA94Cxgb73ON0fs/E/iH/+OpwAagHHgOsMX7/GLwfhcAm/zX+yUg2+jXGvgRsBvYAfwFsBnxWgNP4xuncOH7a+7G/q4toPDNRNwPbMc3iynsY8nSCkIIkSCM1tIRQgjRDwl8IYRIEBL4QgiRICTwhRAiQUjgCyFEgpDAF0KIBCGBL4QQCeL/A6bEHWDFc1wwAAAAAElFTkSuQmCC\n"
          },
          "metadata": {
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "for elm in y_train:\n",
        "  print(elm)"
      ],
      "metadata": {
        "id": "slgykj_QQhN_"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "y_train"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "aIEMPwZLT-6t",
        "outputId": "6e53c5f9-9acf-41b3-f6d0-333aa6a10458"
      },
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "ecg_id\n",
              "1        [NORM]\n",
              "2        [NORM]\n",
              "3        [NORM]\n",
              "4        [NORM]\n",
              "5        [NORM]\n",
              "          ...  \n",
              "21832      [CD]\n",
              "21833    [STTC]\n",
              "21834    [NORM]\n",
              "21835    [STTC]\n",
              "21836    [NORM]\n",
              "Name: diagnostic_superclass, Length: 17441, dtype: object"
            ]
          },
          "metadata": {},
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "cd '/content/drive/My Drive/DSL'"
      ],
      "metadata": {
        "id": "krukaC5mRcQ2",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "84fb3400-cc83-4459-f76d-647ffe0dad03"
      },
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content/drive/My Drive/DSL\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import pickle\n",
        "pickle_out = open(\"X_train.pickle\",\"wb\")\n",
        "pickle.dump(X_train, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_train.pickle\",\"wb\")\n",
        "pickle.dump(y_train, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"X_dev.pickle\",\"wb\")\n",
        "pickle.dump(X_dev, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_dev.pickle\",\"wb\")\n",
        "pickle.dump(y_dev, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"X_test.pickle\",\"wb\")\n",
        "pickle.dump(X_test, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_test.pickle\",\"wb\")\n",
        "pickle.dump(y_test, pickle_out)\n",
        "pickle_out.close()"
      ],
      "metadata": {
        "id": "Gxtc4IkipIwo"
      },
      "execution_count": 14,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "for ecg in X_train: \n",
        "  print(ecg.shape)"
      ],
      "metadata": {
        "id": "SLmJiYSfHUmg"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "<font color=#c33432, size=6>Pre-Processing</font>"
      ],
      "metadata": {
        "id": "Viljd-0QJTDx"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "def labelstovector(X,y):\n",
        "  '''\n",
        "  Convert the labels in y into vectors:\n",
        "  Multi-label problem:\n",
        "  Norm: [0,0,0,0]\n",
        "  MI: [1,0,0,0]\n",
        "  STTC: [0,1,0,0]\n",
        "  CD: [0,0,1,0]\n",
        "  HYP: [0,0,0,1]\n",
        "  Combination example:\n",
        "  HYP and MI: [1,0,0,1]\n",
        "  HYP and CD and STTC: [0,1,1,1]\n",
        "  -----------------------------------------------------------\n",
        "  Args: X (number of examples, signal length, number of leads)\n",
        "        y (number of examples, )\n",
        "  '''\n",
        "  y_list = []\n",
        "  X_list = []\n",
        "  for label, ecg in zip(y,X):\n",
        "    if len(label)!=0: #ignore examples with label = []\n",
        "      aux_vec = np.zeros(4)\n",
        "      if 'MI' in label:\n",
        "        aux_vec[0] = 1\n",
        "      if 'STTC' in label:\n",
        "        aux_vec[1] = 1\n",
        "      if 'CD' in label:\n",
        "        aux_vec[2] = 1\n",
        "      if 'HYP' in label:\n",
        "        aux_vec[3] = 1\n",
        "\n",
        "      #print(label)\n",
        "      #print(aux_vec)\n",
        "      y_list.append(aux_vec)\n",
        "      #print(ecg.shape)\n",
        "      X_list.append(ecg)\t\n",
        "\n",
        "  return X_list, y_list"
      ],
      "metadata": {
        "id": "HLQW0Rnvw9cF"
      },
      "execution_count": 26,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "X_train_processed, y_train_processed = labelstovector(X_train, y_train)\n",
        "X_dev_processed, y_dev_processed = labelstovector(X_dev, y_dev)\n",
        "X_test_processed, y_test_processed = labelstovector(X_test, y_test)"
      ],
      "metadata": {
        "id": "eUqDPk2apDgS"
      },
      "execution_count": 27,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "print(X_train.shape)\n",
        "print(y_train.shape)\n",
        "print(X_dev.shape)\n",
        "print(y_dev.shape)\n",
        "print(X_test.shape)\n",
        "print(y_test.shape)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "yfQbXKKIIrrJ",
        "outputId": "93174afe-756b-4d2d-debb-6b1d9ed5072a"
      },
      "execution_count": 35,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "(17441, 1000, 12)\n",
            "(17441,)\n",
            "(2193, 1000, 12)\n",
            "(2193,)\n",
            "(2203, 1000, 12)\n",
            "(2203,)\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "print(np.asarray(X_train_processed).shape)\n",
        "print(np.asarray(y_train_processed).shape)\n",
        "print(np.asarray(X_dev_processed).shape)\n",
        "print(np.asarray(y_dev_processed).shape)\n",
        "print(np.asarray(X_test_processed).shape)\n",
        "print(np.asarray(y_test_processed).shape)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "XzETZ0lEIIMx",
        "outputId": "6ab43f96-4d4f-4fd0-f9c2-51c006b99b7b"
      },
      "execution_count": 33,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "(17111, 1000, 12)\n",
            "(17111, 4)\n",
            "(2156, 1000, 12)\n",
            "(2156, 4)\n",
            "(2163, 1000, 12)\n",
            "(2163, 4)\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import pickle\n",
        "pickle_out = open(\"X_train_processed.pickle\",\"wb\")\n",
        "pickle.dump(X_train_processed, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_train_processed.pickle\",\"wb\")\n",
        "pickle.dump(y_train_processed, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"X_dev_processed.pickle\",\"wb\")\n",
        "pickle.dump(X_dev_processed, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_dev_processed.pickle\",\"wb\")\n",
        "pickle.dump(y_dev_processed, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"X_test_processed.pickle\",\"wb\")\n",
        "pickle.dump(X_test_processed, pickle_out)\n",
        "pickle_out.close()\n",
        "\n",
        "pickle_out = open(\"y_test_processed.pickle\",\"wb\")\n",
        "pickle.dump(y_test_processed, pickle_out)\n",
        "pickle_out.close()"
      ],
      "metadata": {
        "id": "vOD4akV6Q5B9"
      },
      "execution_count": 36,
      "outputs": []
    }
  ]
}